home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgramD2.iso / Borland / Borland C++ V5.02 / CONTAS2.PAK / CONTRDOC.CPP < prev    next >
C/C++ Source or Header  |  1997-05-06  |  3KB  |  99 lines

  1. // ContrDoc.cpp : implementation of the CContainerDoc class
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "Contain.h"
  6.  
  7. #include "ContrDoc.h"
  8. #include "CntrItem.h"
  9.  
  10. #ifdef _DEBUG
  11. #define new DEBUG_NEW
  12. #undef THIS_FILE
  13. static char THIS_FILE[] = __FILE__;
  14. #endif
  15.  
  16. /////////////////////////////////////////////////////////////////////////////
  17. // CContainerDoc
  18.  
  19. IMPLEMENT_DYNCREATE(CContainerDoc, COleDocument)
  20.  
  21. BEGIN_MESSAGE_MAP(CContainerDoc, COleDocument)
  22.     //{{AFX_MSG_MAP(CContainerDoc)
  23.         // NOTE - the ClassWizard will add and remove mapping macros here.
  24.         //    DO NOT EDIT what you see in these blocks of generated code!
  25.     //}}AFX_MSG_MAP
  26.     // Enable default OLE container implementation
  27.     ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE, COleDocument::OnUpdatePasteMenu)
  28.     ON_UPDATE_COMMAND_UI(ID_EDIT_PASTE_LINK, COleDocument::OnUpdatePasteLinkMenu)
  29.     ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_CONVERT, COleDocument::OnUpdateObjectVerbMenu)
  30.     ON_COMMAND(ID_OLE_EDIT_CONVERT, COleDocument::OnEditConvert)
  31.     ON_UPDATE_COMMAND_UI(ID_OLE_EDIT_LINKS, COleDocument::OnUpdateEditLinksMenu)
  32.     ON_COMMAND(ID_OLE_EDIT_LINKS, COleDocument::OnEditLinks)
  33.     ON_UPDATE_COMMAND_UI(ID_OLE_VERB_FIRST, COleDocument::OnUpdateObjectVerbMenu)
  34. END_MESSAGE_MAP()
  35.  
  36. /////////////////////////////////////////////////////////////////////////////
  37. // CContainerDoc construction/destruction
  38.  
  39. CContainerDoc::CContainerDoc()
  40. {
  41.     // Use OLE compound files
  42.     EnableCompoundFile();
  43.  
  44.     // TODO: add one-time construction code here
  45.  
  46. }
  47.  
  48. CContainerDoc::~CContainerDoc()
  49. {
  50. }
  51.  
  52. BOOL CContainerDoc::OnNewDocument()
  53. {
  54.     if (!COleDocument::OnNewDocument())
  55.         return FALSE;
  56.  
  57.     // TODO: add reinitialization code here
  58.     // (SDI documents will reuse this document)
  59.  
  60.     return TRUE;
  61. }
  62.  
  63. /////////////////////////////////////////////////////////////////////////////
  64. // CContainerDoc serialization
  65.  
  66. void CContainerDoc::Serialize(CArchive& ar)
  67. {
  68.     if (ar.IsStoring())
  69.     {
  70.         // TODO: add storing code here
  71.     }
  72.     else
  73.     {
  74.         // TODO: add loading code here
  75.     }
  76.  
  77.     // Calling the base class COleDocument enables serialization
  78.     //  of the container document's COleClientItem objects.
  79.     COleDocument::Serialize(ar);
  80. }
  81.  
  82. /////////////////////////////////////////////////////////////////////////////
  83. // CContainerDoc diagnostics
  84.  
  85. #ifdef _DEBUG
  86. void CContainerDoc::AssertValid() const
  87. {
  88.     COleDocument::AssertValid();
  89. }
  90.  
  91. void CContainerDoc::Dump(CDumpContext& dc) const
  92. {
  93.     COleDocument::Dump(dc);
  94. }
  95. #endif //_DEBUG
  96.  
  97. /////////////////////////////////////////////////////////////////////////////
  98. // CContainerDoc commands
  99.